
#include<iostream>
#include<vector>
#include<list>

enum eDirection{
  exitTo = 0,
  enterTo = 1,
};

struct Comer {
  eDirection dir{ exitTo };
  int arrive_time{ 0 };
  int pass_time{ 0 };
public:
  Comer(int time, eDirection dir_p):arrive_time(time), dir(dir_p)
  { }
};

class Walker {
  struct blockedData {
    eDirection dir{ exitTo };
    int blocked_time_to{0};
  };

  int timeNow_{ 0 };
  blockedData blockedInfo_{ exitTo , 0 };
  std::list<Comer> cacheToPass_;
  std::vector<Comer> finish_;
public:
  void In(Comer p) {
    if (cacheToPass_.empty())
    {
      p.pass_time = p.arrive_time;
      finish_.push_back(p);
      timeNow_ = p.pass_time + 1;
      return;
    }
    OnDealCache(p);
  }

  void OnDealCache(Comer p) {
    cacheToPass_.insert(cacheToPass_.end(), p);

  }
};

void fun_run() {
  Walker runer;

  runer.In({ 1, exitTo });
}
